package com.lilosoft.generator;

/**
 * Created with IntelliJ IDEA.
 * Description: Mybatis逆向工作
 * User: 小峰
 * Date: 2019-08-26
 * Time: 15:52
 */
public class GeneratorMyBatis {

    public static void main(String[] args) {
        try {
            GeneratorMyBatis generatorSqlmap = new GeneratorMyBatis();
            generatorSqlmap.generator("./src/main/java/com/lilosoft/generator/generatorConfig.xml");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void generator(String xmlFileUrl) throws Exception {

        /*List<String> warnings = new ArrayList<String>();
        boolean overwrite = true;
        // 指定 逆向工程配置文件
        File configFile = new File(xmlFileUrl);
        if (configFile.exists()) {
            ConfigurationParser cp = new ConfigurationParser(warnings);
            Configuration config = cp.parseConfiguration(configFile);
            DefaultShellCallback callback = new DefaultShellCallback(overwrite);
            MyBatisGenerator myBatisGenerator = new MyBatisGenerator(config, callback, warnings);
            myBatisGenerator.generate(null);
        }else{
            System.out.println("文件不存在");
        }*/
    }
}
